# 任务中心
# 用来调度任务

from globally import server_version
import time
from Class_TaskProcessing import PlatForm_CreateAssignment

class TaskCenter:
    @classmethod
    # 任务：增量更新
    def incremental_update(cls, version):
        url_list = server_version[version]
        start_time = time.time()
        PlatForm_CreateAssignment().create_assignments(version)
        end_time = time.time()
        print("%s 用时： %.1d 分钟" % (version, (end_time - start_time) / 60))



# def handle(url, suggestions):
#     removelist = []
#     downloadlist = []
#     for cmd in suggestions:
#         if cmd.startswith('-'):
#             pack = cmd.split(' ')[-1].lstrip().rstrip()
#             removelist.append(pack)
#         if cmd.startswith('+'):
#             pack = cmd.split(' ')[-1].lstrip().rstrip()
#             downloadlist.append(pack)
#     RemovePack(url,removelist).remove()
#     DownloadPack(url, downloadlist).download()